<!doctype html>
<html class="x-admin-sm">
<head>
  <th:block th:insert="head/head :: common_head"></th:block>
    <style>
        .layui-nav-bar:hover {
            background-color: transparent !important; /* 去掉背景色 */
        }
    </style>
</head>
<body>
  <!-- 顶部开始 -->
  <div class="container">
      <div class="logo">
          <a href="javascript:;" th:text="${loginTitle}"></a></div>
      <div class="left_open">
          <a><i title="展开左侧栏" class="iconfont">&#xe699;</i></a>
      </div>
      <ul class="layui-nav left fast-add" lay-filter="">
          <li class="layui-nav-item">
              <a id="sx"><i class="layui-icon layui-icon-refresh"></i></a>
          </li>
      </ul>
      <ul class="layui-nav right" lay-filter="">
            <li class="layui-nav-item to-index">
                <a href="javascript:;" id="user_name"></a>
                  <dl class="layui-nav-child">
                      <!-- 二级菜单 -->
                      <dd>
                          <a onclick="xadmin.open('密码修改','sys/czy/xgmm')">密码修改</a></dd>
                      <dd>
                          <a onclick="xadmin.open('账号切换','login?sfqh=1')">切换账号</a></dd>
                  </dl>
          </li>
      </ul>
  </div>
  <!-- 顶部结束 -->
  <!-- 左侧菜单开始 -->
  <div class="left-nav">
    <div id="side-nav">
      <ul id="nav">

      </ul>
    </div>
  </div>
  <!-- <div class="x-slide_left"></div> -->
  <!-- 左侧菜单结束 -->
  <!-- 右侧主体开始 -->
  <div class="page-content">
    <div class="layui-tab tab" lay-filter="xbs_tab" lay-allowclose="false">
      <ul class="layui-tab-title">
        <li class="home layui-this">
          <i class="layui-icon">&#xe68e;</i>我的桌面</li></ul>
      <div class="layui-unselect layui-form-select layui-form-selected" id="tab_right">
        <dl>
          <dd data-type="this">关闭当前</dd>
          <dd data-type="other">关闭其它</dd>
          <dd data-type="all">关闭全部</dd></dl>
      </div>
      <div class="layui-tab-content">
        <div class="layui-tab-item layui-show">
          <iframe src='welcome' frameborder="0" scrolling="yes" class="x-iframe"></iframe>
        </div>
      </div>
      <div id="tab_show"></div>
    </div>
  </div>
  <div class="page-content-bg"></div>
  <style id="theme_style"></style>
  <!-- 右侧主体结束 -->
  <!-- 中部结束 -->
  <th:block th:insert="head/head :: common_jsfiles"></th:block>
  <script>
    $(document).ready(function() {
      post_json_token("[[${serverUrl}]]/index","","数据加载中...");
    });
    function on_result(result)
    {
      if (result.code==0)
      {
          var rtn = JSON.parse(decrypt_str(result.data,localStorage.getItem("a"),localStorage.getItem("b")));
          var menu = rtn.menu;
          var user = rtn.user;
          var menu_html="";
          menu.forEach(function(obj) {
            //console.info("m:"+obj.menu);
            //console.info("sm:"+obj.submenu);
            menu_html+="<li class=\"layui-nav-item\">\n" +
                    "                <a href=\"javascript:;\">\n" +
                    "<i class=\"layui-icon "+obj.menu.ico+"\" lay-tips=\""+obj.menu.name+"\"></i>   " +
                    "                    <cite>"+obj.menu.name+"</cite>\n" +
                    "                    <i class=\"iconfont nav_right\"></i></a>";
            menu_html+="<ul class=\"sub-menu\">";
            //循环子菜单
            obj.submenu.forEach(function(obj1){
              menu_html+="<li>\n" +
                      "                        <a onclick=\"xadmin.add_tab('"+obj1.name+"','"+obj1.href+"')\">\n" +
                      "                            <i class=\"iconfont\">&#xe6a7;</i>\n" +
                      "                            <cite>"+obj1.name+"</cite></a>\n" +
                      "                    </li>";
            });
            menu_html+="</ul>";
            menu_html+="</li>";
          });
          $("#nav").html(menu_html);
          $("#user_name").html(user.name);
      }
      else
      {
          layer.msg("数据加载失败！");
      }
    }
  </script>
</body>
</html>